package co.gov.medellin.ssti.sub.model.service.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import co.gov.medellin.ssti.sub.model.dao.RenovarDAO;
import co.gov.medellin.ssti.sub.model.dao.exception.DAOException;
import co.gov.medellin.ssti.sub.model.service.RenovarService;
import co.gov.medellin.ssti.sub.model.vo.AtributoVO;
import co.gov.medellin.ssti.sub.model.vo.BeneficiarioVO;
import co.gov.medellin.ssti.sub.model.vo.RenovarVO;

@Service
public class RenovarServiceImpl implements RenovarService {
	@Autowired
	RenovarDAO renovarDAOImpl;

	public Collection<AtributoVO> findAtributosSubpro(Long codeSubprograma) {
		try {
			return renovarDAOImpl.findAtributosSubpro(codeSubprograma);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public String findBeneficiarioAtri(String tipoDato, Long codeBene,
			Long codeAtri) {
		try {
			return renovarDAOImpl.findBeneficiarioAtri(tipoDato, codeBene,
					codeAtri);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public RenovarVO findBeneficioAtri(String tipoDato, Long codeBeneOtor,
			Long codeAtri) {
		try {
			return renovarDAOImpl.findBeneficioAtri(tipoDato, codeBeneOtor,
					codeAtri);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public List<String> findBeneficioOtorgado(Long codeSubpro, Long codeBene) {
		try {
			return renovarDAOImpl.findBeneficioOtorgado(codeSubpro, codeBene);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public List<String> findBeneficioOtorgadoEmpresa(Long codeSubpro,
			Long codeEmpresa) {
		try {
			return renovarDAOImpl.findBeneficioOtorgadoEmpresa(codeSubpro,
					codeEmpresa);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public void findBeneOtorDeshabilitar(Long codeSubpro, Long codeBene,
			Long codeSede) {
		try {
			renovarDAOImpl.findBeneOtorDeshabilitar(codeSubpro, codeBene,
					codeSede);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public List<BeneficiarioVO> findBeneficiarios(Long codeSubpro, Long codeSede) {
		try {
			return renovarDAOImpl.findBeneficiarios(codeSubpro, codeSede);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

}
